projects
/
project
/
ubus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8309c75
)
hook acl into libubus
author
John Crispin
<
[email protected]
>
Sat, 25 Apr 2015 08:10:26 +0000
(10:10 +0200)
committer
John Crispin
<
[email protected]
>
Thu, 18 Jun 2015 17:01:17 +0000
(19:01 +0200)
Signed-off-by: John Crispin <
[email protected]
>
libubus-obj.c
patch
|
blob
|
history
diff --git
a/libubus-obj.c
b/libubus-obj.c
index 8bc83dc62cfd163f32702ebc13605d9067400259..990d04bd9844b8d590c555193742575e58e1458f 100644
(file)
--- a/
libubus-obj.c
+++ b/
libubus-obj.c
@@
-69,7
+69,11
@@
ubus_process_invoke(struct ubus_context *ctx, struct ubus_msghdr *hdr,
req.peer = hdr->peer;
req.seq = hdr->seq;
req.object = obj->id;
-
+ if (attrbuf[UBUS_ATTR_USER] && attrbuf[UBUS_ATTR_GROUP]) {
+ req.acl.user = blobmsg_get_string(attrbuf[UBUS_ATTR_USER]);
+ req.acl.group = blobmsg_get_string(attrbuf[UBUS_ATTR_GROUP]);
+ req.acl.object = obj->name;
+ }
for (method = 0; method < obj->n_methods; method++)
if (!obj->methods[method].name ||
!strcmp(obj->methods[method].name,